<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="../base/head.jsp"%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript">
        function bit() {
            var user = {
                "name":"张三",
                "age":22
            };
            $.ajax({
                url:"jsonType.do",
                data:JSON.stringify(user),
                type:"post",
                contentType: "application/json;charse=UTF-8",
                dataType:"text",
                success:function(data){
                    var obj = eval("(" + data + ")");
                    alert(obj.name+"---"+obj.age);
                }
            });
        }

    </script>
</head>
<body>
<form action="pojoType.do" method="post">
    姓名：<input type="text" name="name"/><br/>
    年龄：<input type="text" name="age"/><br/>
    地址编号：<input type="text" name="address.id"/><br/>
    地址：<input type="text" name="address.name"/><br/>

    <input type="submit" value="提交"/> <br/><br/><br/><br/>

    <input type="button" value="点我" onclick="bit()"/> <br/><br/><br/><br/>

</form>
</body>
</html>